AccountExpires -> EmployeeEndDate Attribute Flow

Hello,

I'm wondering if anyone has any resources on mapping AccountExpires (AD) -> EmployeeEndDate (FIM). I understand that this has to be done by rules extensions or advance attribute flows. Unfortionatly I do not have experience with either. Any help is appreciated.

thanks,

Josh

April 27th, 2015 8:53pm

Hello,

I've done something similar with the pwdLastSet attribute which has the same format in AD as AccountExpires
(100-nanosec. since Jan. 1, 1601)

So best ist to do an advanced flow from AD to MV in the correct format for FIM portal.

Create a extension project for the advanced attribute flow you create first from AD to MV attribute:

In the MapAttributeForImport Method paste a code like this:

            Case "updatePwdLastSet"
                If (csentry("pwdLastSet").IsPresent) Then
                    If (csentry("pwdLastSet").Value <> "0") Then
                        Dim dtFileTimeUTC As DateTime = DateTime.FromFileTimeUtc(csentry("pwdLastSet").IntegerValue)
                        mventry("pwdLastSet").Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'")
                    Else
                        mventry("pwdLastSet").Delete()
                    End If
                End If

Simple replace the attribute names in this example.

/Peter

Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 3:58am

Thank you!

I ended up using C# but your code helped a lot. For others who are looking for a solution, this is what I used.

void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)
        {
            switch (FlowRuleName){
                case "getPwdLastSet":
                    if ((csentry["pwdLastSet"].IsPresent) && (csentry["pwdLastSet"].Value != "0"))
                    {
                        DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["pwdLastSet"].IntegerValue);
                        mventry["_pwdlastset"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                    }
                    break;
                case "getAccountExpires":
                    if ((csentry["accountExpires"].IsPresent) && (csentry["accountExpires"].Value != "9223372036854775807")) {
                        DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["accountExpires"].IntegerValue);
                        mventry["employeeEndDate"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                    }
                    break;
                
            }  
        }

  • Marked as answer by Jgonsalves 12 hours 39 minutes ago
April 28th, 2015 2:46pm

Thank you!

I ended up using C# but your code helped a lot. For others who are looking for a solution, this is what I used.

void IMASynchronization.MapAttributesForImport( string FlowRuleName, CSEntry csentry, MVEntry mventry)
        {
            switch (FlowRuleName){
                case "getPwdLastSet":
                    if ((csentry["pwdLastSet"].IsPresent) && (csentry["pwdLastSet"].Value != "0"))
                    {
                        DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["pwdLastSet"].IntegerValue);
                        mventry["_pwdlastset"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                    }
                    break;
                case "getAccountExpires":
                    if ((csentry["accountExpires"].IsPresent) && (csentry["accountExpires"].Value != "9223372036854775807")) {
                        DateTime dtFileTimeUTC = DateTime.FromFileTimeUtc(csentry["accountExpires"].IntegerValue);
                        mventry["employeeEndDate"].Value = dtFileTimeUTC.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'");
                    }
                    break;
                
            }  
        }

  • Marked as answer by Jgonsalves Tuesday, April 28, 2015 6:45 PM
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2015 6:45pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics